package com.entity;

import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

public class FiledModelOfEntity {
    /**
     * 数据库注释
     */
    private String comment;
    /**
     * 是否是数字类型；数字类型返回1
     */
    private String numberFiled = "0";

    private String dateFiled = "0";
    /**
     * filed 对应的 java类型
     */
    private String javaType;
    /**
     * filed 名称
     */
    private String name;
    /***
     * 数据库类型
     */
    private String dbType;
    /***
     * 列信息
     */
    private String column;
    /***
     * 如果 此列是主键，则设置成1
     */
    private String idFiled = "0";
    /**
     * 最大长度
     */
    private Integer maxLength;

    private Integer exist = 1;

    private String startFiledName;

    private String  getFileName;

    private String fileName;


    public int getHaveId() {
        return Objects.equals(idFiled, "0") && name.toLowerCase().contains("id") ? 1 : 0;
    }

    public String getDateFiled() {
        return dateFiled;
    }

    public void setDateFiled(String dateFiled) {
        this.dateFiled = dateFiled;
    }

    public Integer getMaxLength() {
        return maxLength;
    }

    public void setMaxLength(Integer maxLength) {
        this.maxLength = maxLength;
    }

    public String getIdFiled() {
        return idFiled;
    }

    public void setIdFiled(String idFiled) {
        this.idFiled = idFiled;
    }

    public String getDbType() {
        return dbType;
    }

    public void setDbType(String dbType) {
        this.dbType = dbType;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getNumberFiled() {
        return numberFiled;
    }

    public void setNumberFiled(String numberFiled) {
        this.numberFiled = numberFiled;
    }

    public String getJavaType() {
        return javaType;
    }

    public void setJavaType(String javaType) {
        this.javaType = javaType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColumn() {
        return column;
    }

    public void setColumn(String column) {
        this.column = column;
    }

    public Integer getExist() {
        return exist;
    }

    public void setExist(Integer exist) {
        this.exist = exist;
    }

    public String getStartFiledName() {
        return startFiledName;
    }

    public void setStartFiledName(String startFiledName) {
        this.startFiledName = startFiledName;
    }

    public Integer getStartFileNameVal() {
        return StringUtils.isEmpty(startFiledName) ? 0 : 1;
    }

    public String getGetFileName() {
        return getFileName;
    }

    public void setGetFileName(String getFileName) {
        this.getFileName = getFileName;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }
}
